import requests

from config import BASE_URL


class EmpApi(object):
    def __init__(self):
        self.emp_url = BASE_URL + "/api/sys/user"

    def add_emp(self, body, au_headers):
        response = requests.post(self.emp_url, json=body, headers=au_headers)
        return response

    def query_emp(self, query, au_headers):
        response = requests.get(self.emp_url + '/' + query, headers=au_headers)
        return response

    def modify_emp(self, body, query, au_headers):
        response = requests.put(self.emp_url + '/' + query, json=body, headers=au_headers)
        return response

    def delete_emp(self, query, au_headers):
        response = requests.delete(self.emp_url + '/' + query, headers=au_headers)
        return response
